/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author elfatah
 */
@Entity
@Table(name = "pengadaan")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pengadaan.findAll", query = "SELECT p FROM Pengadaan p"),
    @NamedQuery(name = "Pengadaan.findByPengadaanId", query = "SELECT p FROM Pengadaan p WHERE p.pengadaanId = :pengadaanId"),
    @NamedQuery(name = "Pengadaan.findByIdPegawai", query = "SELECT p FROM Pengadaan p WHERE p.idPegawai = :idPegawai"),
    @NamedQuery(name = "Pengadaan.findByIdSupplyer", query = "SELECT p FROM Pengadaan p WHERE p.idSupplyer = :idSupplyer"),
    @NamedQuery(name = "Pengadaan.findByIdBarang", query = "SELECT p FROM Pengadaan p WHERE p.idBarang = :idBarang"),
    @NamedQuery(name = "Pengadaan.findByJumlahBarang", query = "SELECT p FROM Pengadaan p WHERE p.jumlahBarang = :jumlahBarang"),
    @NamedQuery(name = "Pengadaan.findByTanggal", query = "SELECT p FROM Pengadaan p WHERE p.tanggal = :tanggal"),
    @NamedQuery(name = "Pengadaan.findByJumlahHarga", query = "SELECT p FROM Pengadaan p WHERE p.jumlahHarga = :jumlahHarga")})
public class Pengadaan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PENGADAAN_ID")
    private Integer pengadaanId=0;
    @Column(name = "ID_PEGAWAI")
    private Integer idPegawai=0;
    @Column(name = "ID_SUPPLYER")
    private Integer idSupplyer=0;
    @Column(name = "ID_BARANG")
    private Integer idBarang=0;
    @Column(name = "JUMLAH_BARANG")
    private Integer jumlahBarang=0;
    @Column(name = "TANGGAL")
    @Temporal(TemporalType.TIMESTAMP)
    private Date tanggal;
    @Column(name = "HARGA_SATUAN")
    private Integer hargaSatuan=0;
    @Column(name = "JUMLAH_HARGA")
    private String jumlahHarga="";

    private String noPegawai="",noSupplier="", namaPegawai="", namaSupplyer="",namaBarang="",tgl="",action="Insert";
    
    public Pengadaan() {
    }

    public String getNoPegawai() {
        return noPegawai;
    }

    public void setNoPegawai(String noPegawai) {
        this.noPegawai = noPegawai;
    }

    public String getNoSupplier() {
        return noSupplier;
    }

    public void setNoSupplier(String noSupplier) {
        this.noSupplier = noSupplier;
    }

    public String getNamaPegawai() {
        return namaPegawai;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getTgl() {
        return tgl;
    }

    public void setTgl(String tgl) {
        this.tgl = tgl;
    }

    public void setNamaPegawai(String namaPegawai) {
        this.namaPegawai = namaPegawai;
    }

    public String getNamaSupplyer() {
        return namaSupplyer;
    }

    public void setNamaSupplyer(String namaSupplyer) {
        this.namaSupplyer = namaSupplyer;
    }

    public String getNamaBarang() {
        return namaBarang;
    }

    public void setNamaBarang(String namaBarang) {
        this.namaBarang = namaBarang;
    }

    public Pengadaan(Integer pengadaanId) {
        this.pengadaanId = pengadaanId;
    }

    public Integer getPengadaanId() {
        return pengadaanId;
    }

    public void setPengadaanId(Integer pengadaanId) {
        this.pengadaanId = pengadaanId;
    }

    public Integer getHargaSatuan() {
        return hargaSatuan;
    }

    public void setHargaSatuan(Integer hargaSatuan) {
        this.hargaSatuan = hargaSatuan;
    }

    public Integer getIdPegawai() {
        return idPegawai;
    }

    public void setIdPegawai(Integer idPegawai) {
        this.idPegawai = idPegawai;
    }

    public Integer getIdSupplyer() {
        return idSupplyer;
    }

    public void setIdSupplyer(Integer idSupplyer) {
        this.idSupplyer = idSupplyer;
    }

    public Integer getIdBarang() {
        return idBarang;
    }

    public void setIdBarang(Integer idBarang) {
        this.idBarang = idBarang;
    }

    public Integer getJumlahBarang() {
        return jumlahBarang;
    }

    public void setJumlahBarang(Integer jumlahBarang) {
        this.jumlahBarang = jumlahBarang;
    }

    public Date getTanggal() {
        return tanggal;
    }

    public void setTanggal(Date tanggal) {
        this.tanggal = tanggal;
    }

    public String getJumlahHarga() {
        return jumlahHarga;
    }

    public void setJumlahHarga(String jumlahHarga) {
        this.jumlahHarga = jumlahHarga;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pengadaanId != null ? pengadaanId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pengadaan)) {
            return false;
        }
        Pengadaan other = (Pengadaan) object;
        if ((this.pengadaanId == null && other.pengadaanId != null) || (this.pengadaanId != null && !this.pengadaanId.equals(other.pengadaanId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Pengadaan[ pengadaanId=" + pengadaanId + " ]";
    }
    
}
